<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>点赞</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.9/vue.js"></script>
</head>
<body>
    <!-- <div id="app" @click="handler">❤ {{heart}}</div> -->
    <div id="app" @click="heart++">❤ {{heart}}</div>
</body>
<script>
    var vm = new Vue({
        el:"#app",
        data() {
            return {
                heart:0
            }
        },
        methods: {
            handler() {
                this.heart++
            }
        }
    })
</script>
</html>